﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Logging
{
    public class SimpleLoggerConsoleAppender : SimpleLoggerAppender
    {
        private SimpleLoggerFormatter formatter;

        public SimpleLoggerConsoleAppender(SimpleLoggerFormatter formatter)
        {
            this.formatter = formatter;
        }

        public void append(SimpleLogRecord logRecord)
        {
            System.Console.Out.Write(formatter.format(logRecord));
        }

        public void flush()
        {
            System.Console.Out.Flush();
        }

        public void close()
        {
            System.Console.Out.Close();
        }
    }
}
